<%@page import="java.sql.SQLException"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="database.DAO, golf.Account"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	DAO dao = DAO.getInstance();
	int psNo;
	String accountId;
	Account account;
	try{
		psNo = Integer.parseInt( request.getParameter("buyPsno") );
		accountId = (String)session.getAttribute("accountID");
		if( dao.setProductService(accountId, psNo) )
		{
			System.out.println("요금상품 구매가 완료되었습니다.");
		}
		
	}catch(NumberFormatException nfe){
		System.out.println("요금상품번호가 제대로 읽혀지지 않았습니다.");
	}catch(Exception e){
		
	}
	response.sendRedirect("../jsp/purchase.jsp");
	
	
	
%>
</body>
</html>